var hostProductAmount = 0;
$(function() {
            var lilgh = $("#host_img li").length;
            var liw = $("#host_img li").width()+21; //21为固定的margin宽度
            $("#host_img").css("width",lilgh*liw);
            
			hostProductAmount = $("li[id^='host_product_']").size();
			$("#arrow_l").click(function() {
						// 计算出第1个与最后一个
						var firstIndex = parseInt($("li[id^='host_product_']:visible:first").attr("name"));
						var lastIndex = parseInt($("li[id^='host_product_']:visible:last").attr("name"));
						var showLastIndex = lastIndex + 1;
						if (showLastIndex > hostProductAmount)
							showLastIndex = 1;
						$("#host_product_" + firstIndex).hide().insertAfter($("li[id^='host_product_']:hidden:last"));
						$("#host_product_" + showLastIndex).show();
					});

			$("#arrow_r").click(function() {
						// 计算出第1个与最后一个
						var firstIndex = parseInt($("li[id^='host_product_']:visible:first").attr("name"));
						var lastIndex = parseInt($("li[id^='host_product_']:visible:last").attr("name"));
						var showFirstIndex = firstIndex - 1;
						if (showFirstIndex == 0)
							showFirstIndex = hostProductAmount;
						$("#host_product_" + lastIndex).hide();
						$("#host_product_" + showFirstIndex).insertBefore($("li[id^='host_product_']:visible:first")).show();
					});
		});
